<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:hf="http://java.sun.com/jsf/composite/tags"
	template="../templates/template.xhtml">
	
	<ui:define name="leftMenu">
		<ui:include src="../templates/userMenu.xhtml" >
			<ui:param name="usersClass" value="disabled" />
			<ui:param name="userNewClass" value="disabled" />
		</ui:include>
	</ui:define>

	<ui:param name="pageTitle" value="#{messages['changePassword.title']}" />
	<ui:define name="content">
		
		<h:form >
			<p:messages id="messages" showDetail="true" autoUpdate="true" />
			<hf:formField label="#{messages['user.firstname']}" edit="false" entity="#{changePasswordBean.currentUser}" field="firstName" />
			<hf:formField label="#{messages['user.lastname']}" edit="false" entity="#{changePasswordBean.currentUser}" field="lastName" />
			<hf:formField label="#{messages['user.username']}" edit="false" entity="#{changePasswordBean.currentUser}" field="username" />
			<hf:formField label="#{messages['user.email']}" edit="false" entity="#{changePasswordBean.currentUser}" field="email" />
			
			<h:outputLabel for="oldpwd" value="#{messages['password.old']}" />
			<p:password id="oldpwd" value="#{changePasswordBean.oldPassword}" label="#{messages['password.old']}" required="true" />
		
			<h:outputLabel for="pwd1" value="#{messages['password.new']}" />
			<p:password id="pwd1" value="#{changePasswordBean.newPassword}" match="pwd2" label="#{messages['password.new']}" required="true" feedback="true" promptLabel="#{messages['password.enterPassword']}" weakLabel="#{messages['password.weak']}"  
                       goodLabel="#{messages['password.good']}" strongLabel="#{messages['password.strong']}" />  
			<h:outputLabel for="pwd2" value="#{messages['password.confirmPassword']}" />
			<p:password id="pwd2" value="#{changePasswordBean.newPassword}" label="#{messages['password.confirmPassword']}" required="true"/>
					
			<h:commandButton value="#{messages['action.save']}" action="#{changePasswordBean.changePassword}" icon="ui-icon-check" styleClass="btn btn-primary" />
		</h:form>
		
	</ui:define>
</ui:composition>
